﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices; // DllImport

namespace Copy4Backup
{
	internal static class NativeMethods
	{
		#region DllImports
		[DllImport("kernel32.dll", SetLastError = true)]
		internal static extern IntPtr CreateFile(String lpFileName,
												Int32 dwDesiredAccess,
												Int32 dwShareMode,
												IntPtr lpSecurityAttributes,
												Int32 dwCreationDisposition,
												Int32 dwFlagsAndAttributes,
												IntPtr hTemplateFile);

		[DllImport("kernel32.dll", SetLastError = true)]
		internal static extern Int32 CloseHandle(IntPtr hObject);

		[DllImport("kernel32.dll", SetLastError = true)]
		internal static extern Int32 DeviceIoControl(IntPtr hDevice,
													 Int32 dwIoControlCode,
													 IntPtr lpInBuffer,
													 Int32 nInBufferSize,
													 IntPtr lpOutBuffer,
													 Int32 nOutBufferSize,
													 out Int32 lpBytesReturned,
													 IntPtr lpOverlapped);
		#endregion DllImports

	}
}
